#!/bin/bash

/usr/bin/cvs diff -u {cp_,ewald_,math,pw_}*.F > ${QUIP_ROOT}/QUIP_Core/cp2k_driver/cp2k_speed.patch 
/usr/bin/cvs diff -u motion_utils.F > ${QUIP_ROOT}/QUIP_Core/cp2k_driver/motion_utils.F.patch 
/usr/bin/cvs diff -u {md_energies,input_cp2k_motion}.F > ${QUIP_ROOT}/QUIP_Core/cp2k_driver/cp2k_print_selected_atoms.patch 
/usr/bin/cvs diff -u {input_constants.F,input_cp2k_subsys.F,topology.F,OBJECTDEFS} > ${QUIP_ROOT}/QUIP_Core/cp2k_driver/cp2k_exyz.patch
nl=`wc -l < topology_exyz.F`
cat<<EOF >> $QUIP_ROOT/QUIP_Core/cp2k_driver/cp2k_exyz.patch
diff --new-file -u -r1.41 topology_exyz.F 
--- topology_exyz.F	1969-12-31 19:00:00.000000000 -0500
+++ topology_exyz.F	2010-08-12 17:12:19.000000000 -0400
@@ -0,0 +1,$nl @@
EOF
sed 's/^/+/' topology_exyz.F >> $QUIP_ROOT/QUIP_Core/cp2k_driver/cp2k_exyz.patch
